<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
		<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
		<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
		<title>注册</title>
		<link rel="stylesheet" href="css/style.css" />
		<style>
		#btRegister,#goback {
			background-color: rgba(0, 0, 0, 0);
			color: #FFAA00;
			border: 0px;
			text-shadow: 0;
			font-size: 1rem;
		}
		
		#btRegister:target,#goback:target {
			background-color: rgba(0, 0, 0, 0);
			color: #FFAAFF;
			border: 0px;
			text-shadow: 0;
			font-size: 1rem;
		}
		</style>
		<script>$.mobile.ajaxEnabled = false;</script>
	</head>
	<body>
		<div data-role="page">
			<div data-role="header" id="opcitybg">
				<h1>注册</h1>
			</div>

			<div data-role="main" class="ui-content">
				<form method="get" userion="c_register.html">
					<div class="ui-field-contain">
						<label for="uname">用户名：</label>
						<input type="text" name="uname" id="uname">
						<label for="bday">生日：</label>
						<input type="date" name="bday" id="bday">
						<label for="email">E-mail:</label>
						<input type="email" name="email" id="email" placeholder="你的电子邮箱..">
						<label for="tel">Tel:</label>
						<input type="tel" name="tel" id="tel" placeholder="电话号码..">
						<label for="province">所在省市:</label>
						<input type="text" name="province" id="province">
						<label for="aDetial">详细地址:</label>
						<textarea name="aDetial" id="aDetial" placeholder="具体收货地址"></textarea>
						<label for="password">密码:</label>
						<input type="password" name="password" id="password">
						<label for="repassword">确认密码:</label>
						<input type="password" name="repassword" id="repassword">
						<label for="verify"><img src="img/verify/DFEC.jfif"></label>
						<input type="text" name="verify" id="verify" placeholder="请输入验证码..">
					</div>
					


					<div data-role="footer" data-position="fixed" id="footerbg">
						<div data-role="navbar">
							<ul id="headop">
								<li><a id="btRegister">注册</a></li>
								<li><a href="c_login.html" id="goback" >登录</a></li>
							</ul>
						</div>
					</div>
					
				</form>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="js/login/checkMessage.js"></script>
	<script type="text/javascript" src="js/login/register.js"></script>
	<script type="text/javascript">
		console.log(uname.value);
		console.log(password.value)
		//验证用户名
		uname.onchange = function() {
			checkName(uname.value);
		}

		//验证密码
		password.onchange = function() {
			checkPassword(password.value);
		}
		//验证密码一致性
		repassword.onchange = function() {
			recheckPassword(password.value, repassword.value);
		}
		//注册，存储数据
		btRegister.onclick = function() {
			if(checkForm(uname.value, password.value, repassword.value)){
				register();
				//跳转到首页
				location.href="c_login.html";
			}
		}
		
		
		
		//注册
		function register() {
			userObj=setUserContent(userObj);
			//存储用户
			storageObj(userObj.id,userObj);
			//更新用户索引
			filterUserLocal();
		}
	</script>
</html>
